<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf"><?= $title?>列表</div>
                </div>
                <div class="widget-body am-fr">
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-hover tpl-table-black">
                            <thead>
                            <tr>
                                <th>Applet_Id</th>
                                <th>图标</th>
                                <th>名称</th>
                                <th>电话</th>
								<th>模板</th>
                                <th>授权</th>
								<th>代理</th>
								<th>来源</th>
								<th>到期时间</th>
                                <th>管理</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if !$list->isEmpty()}
                                {foreach $list as $item}
                                <tr>
                                    <td class="am-text-middle">{$item['applet_id']}</td>
                                    <td class="am-text-middle">
                                        <img src="{$item['head_img']}" width="50" height="50" alt="小程序图片">
                                    </td>
                                    <td class="am-text-middle">
                                        <p class="item-title">{$item['app_name']|default='--'}</p>
                                    </td>
                                    <td class="am-text-middle">{$item['phone']|default='--'}</td>
									<td class="am-text-middle">{$item['template']['name']}</td>
                                    <td class="am-text-middle">
										<span class="{$item['status']['value'] == 0 ? 'x-color-red' : 'x-color-green'}">
                                            {$item['status']['text']}
                                         </span>
									</td>
									<td class="am-text-middle">
										<span class="{$item['agent_id'] ? 'x-color-red' : 'x-color-green'}">
                                            {$item['agent_id']?$item['agent_id']:'平台'}
                                         </span>
									</td>
									<td class="am-text-middle">{$item['source']['text']}</td>
									<td class="am-text-middle">{$item['expire_time']['text']} </td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
											<a class="hema-renewal tpl-table-black-operation-green"
                                                href="javascript:void(0);"
                                                data-id="{$item['applet_id']}"
												data-expire="{$item['expire_time']['text']}">
												<i class="am-icon-clock-o"></i> 续期
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                            {else /}
                                <tr>
                                    <td colspan="10" class="am-text-center">暂无记录</td>
                                </tr>
                            {/if}
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr">{:$list->render()} </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：{:$list->total()}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="applet/tpl_genewal" /}
<script>
    $(function () {
		
		/**
         * 变更到期时间操作
         */
        $('.hema-renewal').on('click', function () {
            var data = $(this).data();
            $.showAction({
                title: '变更到期时间操作', 
                area: '460px', 
                content: template('tpl-genewal', data), 
                uCheck: true, 
                success: function ($content) {
                    $('#my-form').formPost({
                        url: "{:url('applet/renewal')}?id=" + data.id
                    });
                }, 
                btn2: function ($content) {
                    return true;
                }
            });
        });

    });
</script>

